﻿using eProcurement.BLL;
using eProcurement.controls;
using eProcurement.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace eProcurement.members
{
    public partial class CompanyListing : System.Web.UI.Page
    {
        protected void Page_Load( object sender, EventArgs e )
        {
            if ( !IsPostBack )
            {
                Manager manager = new Manager();

                List<Purchaser> purchasers = manager.GetPurchaserIgnoreProjects();
                foreach ( Purchaser purchaser in purchasers )
                {
                    CompanyItemControl control = (CompanyItemControl)LoadControl( "../controls/CompanyItemControl.ascx" );
                    control.Setup( purchaser );
                    container.Controls.Add( control );
                }
            }
        }
    }
}